package v2.com.autoresource;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import v2.com.autoresource.model.dao.TbOrder;
import v2.com.autoresource.service.OrderService;
import v2.com.autoresource.utils.BeanConstext;

import java.util.List;

/**
 * @ProjectName: learning
 * @Package: com.autoresource
 * @ClassName: AutoSelectDataResourceApplication
 * @Description:
 * @Date: 2021/11/1 7:28 下午
 * @Version: 1.0
 */
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class}, scanBasePackages = "v2.com.autoresource")
@MapperScan(basePackages = {"v2.com.autoresource.mapper"})
public class AutoSelectDataResourceApplication {

    public static void main(String[] args) {
        SpringApplication.run(AutoSelectDataResourceApplication.class, args);
        OrderService orderService = BeanConstext.getBean(OrderService.class);
        // orderService.insertOrder();
        //   orderService.batchInsertOrder();
        List<TbOrder> tbOrders = orderService.batchQueryByIds(1000, 10000);
        System.out.println(tbOrders);

    }
}
